<template>
  <div class="system-settings">
    <div class="settings-container">
      <!-- 设置导航 -->
      <el-card class="nav-card">
        <el-tabs v-model="activeTab" @tab-click="handleTabClick">
          <el-tab-pane label="视频流管理" name="video-stream">
            <VideoStreamManagement />
          </el-tab-pane>
          <el-tab-pane label="Udp配置" name="udp-config">
            <UdpMonitor/>
          </el-tab-pane>
          <el-tab-pane label="Tcp配置" name="tcp-config">
            <TcpSetting/>
          </el-tab-pane>
          <el-tab-pane label="任务类型管理" name="taskType-config">
              <TaskTypeManagement />
          </el-tab-pane>
          <el-tab-pane label="结果快报模板" name="report-template">
              <ResultReportTemplateManagement />
          </el-tab-pane>
          <el-tab-pane label="日志管理" name="log-management">
            <LogManagement />
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import VideoStreamManagement from './VideoStreamManagement.vue';
import TaskTypeManagement from "./TaskTypeManagement.vue";
import UdpMonitor from "./UdpMonitor.vue";
import TcpSetting from "./TcpSetting.vue";
import ResultReportTemplateManagement from "./ResultReportTemplateManagement.vue";
import LogManagement from './LogManagement.vue';

// 当前激活的标签页
const activeTab = ref('video-stream');

// 标签页切换处理
const handleTabClick = (tab) => {
  console.log('切换到标签页:', tab.props.name);
};
</script>

<style scoped>
.system-settings {
  padding: 0 10px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.settings-container {
  width: 100%;
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.nav-card {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
  border: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
}

.nav-card :deep(.el-tabs__header) {
  margin-bottom: 20px;
  border-bottom: 1px solid #ebeef5;
}

.nav-card :deep(.el-tabs__nav-wrap) {
  padding: 0 20px;
}

.nav-card :deep(.el-tabs__item) {
  font-size: 16px;
  font-weight: 500;
  padding: 0 20px;
}

.nav-card :deep(.el-tabs__content) {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.system-config,
.log-management {
  padding: 40px 0;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-card :deep(.el-tab-pane) {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .system-settings {
    padding: 0 10px;
  }

  .nav-card :deep(.el-tabs__nav-wrap) {
    padding: 0 10px;
  }

    .nav-card :deep(.el-tabs__content) {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
  }

  .nav-card :deep(.el-tabs__item) {
    font-size: 14px;
    padding: 0 15px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .system-settings {
    padding: 0 10px;
  }
}

@media (min-width: 1025px) {
  .system-settings {
    padding: 0 10px;
  }
}
</style>
